<?php 
	session_start();

	if($_SESSION['security_code'] == $_POST['captcha']) {

		$db = mysqli_connect("localhost","root","","ajax_form");
		$username = mysqli_real_escape_string($db,$_POST['name']);
		$password = mysqli_real_escape_string($db,$_POST['password']);
		$hash_pass = sha1($password);
		$email = $_POST['email'];

		$query = "INSERT INTO signup(user_name,password,email) VALUES ('".$username."','".$hash_pass."','".$email."')";
		$result = mysqli_query($db,$query);
		echo "true";
	} else {
		echo "false";
	}



?>